package com.atkxp.dao;

import com.atkxp.pojo.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author user
 * @declaration
 * @create 2022/10/31-23:37
 */
@Repository
public interface UserMapper {
    //添加一个用户
    int savaUser(User user);

    User queryUserByName(String name);

    List<User> getTopSevenUserOrderByBlogNum();

    User queryUserByNameAndPassword(@Param("name") String name, @Param("password") String password);

    int updateUser(User user);

    List<User> getAllUser();
    Integer setHeadImg(User user);

    User queryUsrById(int id);

    List<Integer> getSubscribeUser(int userId);

    int subscribe(int userId);

    int unsubscribe(int userId);

    int subscribeAddRelation(Map relationship);

    int unsubscribeDeleteRelation(@Param("userId") int userId, @Param("followUserId") int followUserId);

    Long existFollowRelationship(@Param("userId") int userId, @Param("followUserId") int followUserId);

    Long getFollowCount(int followUserId);
}
